# -*- coding: utf-8 -*-
from django.core import serializers
from django.http import HttpResponse
from django.shortcuts import render_to_response
from models import Fornecedor

def index(request):
    return render_to_response('index.html',)

def get_fornecedores(request):
    fornecedores = Fornecedor.objects.all()
    retorno = serializers.serialize("json",  fornecedores)
    return HttpResponse(retorno, mimetype="text/javascript")
